{% extends "base.html" %}
{% load uni_form_tags %}

{% block title %} Invent an idea - {{ block.super }} {% endblock %}

{% block content %}


<h2> Available article notes </h2> 

<ul>
{% for articlenote in article_notes %}
   <li> {{ articlenote.article.title }}: {{ articlenote.quotation }} 
   <form method="POST" action="{% url article_upnote %}" >
     <input type="hidden" name = "note_id" value ="{{ articlenote.id }}" />
     <input type="hidden" name = "dontvalidate" value = "yes" />
     <input type="submit" value ="Update" />
   </form>  
   </li>
{% endfor %}
</ul>

{% ifequal saveok 'no' %} 
<h2> Add a note to {{ article.title }} </h2> 

<form  method="POST" class="uniForm" action ="{% url article_addnote %}"> 
    <input type="hidden" name = "article_id" value = "{{ article.id }}" />
    <input type="hidden" name = "dontvalidate" value = "no" />
    <fieldset>
      {{ articlenoteform|as_uni_form }}
   </fieldset>

<div class="buttonHolder">
    <button type="submit" class="primaryAction">Add</button>
  </div>

    
</form>
{% endifequal %}

{% ifequal saveok 'yes' %}

 your note is added successfully, 

<form  method="POST" action ="{% url article_addnote %}"> 
    <input type="hidden" name = "article_id" value = "{{ article.id }}" />
    <input type="hidden" name = "dontvalidate" value = "yes" />
    <input type="submit" value ="Add Another" /> 
</form>

{% endifequal %}


{% endblock %}

